

<script setup>
  import sonCpn from "@components/sonCpn.vue"
  import {ref} from "vue"

  const car = ref("宝马车")
  const moneny = ref(0);

  const addMoneny = () => {
    moneny.value += 100;
  }

const changeFn = (newMoneny) => {
    moneny.value -= newMoneny
}

</script>

<template>
  <button @click="addMoneny">+100 : {{moneny}}</button>
  <sonCpn :car="car" :moneny="moneny" @changeMoney="changeFn"></sonCpn>
    
</template>
